import { defHttp } from '/@/utils/http/axios';
import { ValidateCodeInfo } from './model/captchaModel';

import { ErrorMessageMode } from '/#/axios';

enum Api {
  GetValidateCode = '/captcha',
}

/**
 * @description: 验证码api
 */
export function captchaApi(mode: ErrorMessageMode = 'modal') {
  return defHttp.get<ValidateCodeInfo>(
    {
      url: Api.GetValidateCode,
    },
    {
      errorMessageMode: mode,
      isTransformResponse: false,
    },
  );
}
